package com.cskaoyan;

import com.cskaoyan.utils.JDBCUtils1;
import com.cskaoyan.utils.JDBCUtils2;
import com.mysql.jdbc.Driver;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * 第一次去连接数据库
 * 创建日期: 2022/02/23 10:13
 *
 * @author ciggar
 */
public class Main4UseUtils {

    public static void main(String[] args) throws SQLException {

        // 获取连接
        Connection connection = JDBCUtils2.getConnection();

        Statement statement = connection.createStatement();

        int affectedRows = statement.executeUpdate("delete from clazz where id = 8");

        System.out.println(affectedRows);

        // 关闭资源
        JDBCUtils2.releaseResouce(null,statement,connection);

    }
}
